package com.chapter10.innerclass_;

/**
 * 静态内部类：
 * 和成员内部类位置相同但多了static修饰
 */
public class StaticInnerClass01 {
    public static void main(String[] args) {
        Outer09 outer09 = new Outer09();
        outer09.hi();
    }
}

class Outer09 {
    private int n1 = 10;
    private static int n2 = 20;

    static class Inner09 {
        public void say() {
            //不能直接访问外部类的非静态成员
            System.out.println("n2 = " + n2);
        }
    }
    //外部类使用内部类
    public void hi(){
        new Inner09().say();
    }
}
